package Plan;
import java.awt.*;
import java.util.Random;

public class Enemy {
    private int x, y;
    private int speed;
    private Random random;
    
    public Enemy(int x, int y) {
        this.x = x;
        this.y = y;
        this.random = new Random();
        this.speed = random.nextInt(3) + 1;
    }
    
    public void update() {
        y += speed;
    }
    
    public void draw(Graphics g) {
        g.setColor(Color.RED);
        g.fillRect(x, y, 40, 40);
    }
    
    public Rectangle getBounds() {
        return new Rectangle(x, y, 40, 40);
    }
    
    public int getY() {
        return y;
    }
}